//
//  MCMineHeaderFooterView.m
//  TLYL
//
//  Created by MC on 2017/6/12.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCMineHeaderFooterView.h"
#define WIDTH_HeaderFooterView  (G_SCREENWIDTH-100)
@interface MCMineHeaderFooterView ()

@property (nonatomic,strong)UIView * view_back;
@property (nonatomic,strong)UIView * view_line1;
@property (nonatomic,strong)UIView * view_line2;
@end
@implementation MCMineHeaderFooterView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
    }
    return self;
}

-(void)createUI{

    _view_back=[[UIView alloc]init];
    _view_back.backgroundColor=[UIColor whiteColor];
    [self addSubview:_view_back];
    _view_back.layer.cornerRadius=25;
    _view_back.layer.masksToBounds = YES;
//    _view_back.layer.borderWidth = 1.0;
//    _view_back.layer.borderColor = [[UIColor grayColor] CGColor];
    [_view_back mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(0);
        make.right.equalTo(self.mas_right).offset(0);
        make.left.equalTo(self.mas_left).offset(0);
        make.bottom.equalTo(self.mas_bottom).offset(0);
    }];
    
    //充值
    _btn_recharge=[[UIButton alloc]init];
    [_btn_recharge setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_btn_recharge setTitle:@"充值" forState:UIControlStateNormal];
    [self addSubview:_btn_recharge];
    [_btn_recharge mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(WIDTH_HeaderFooterView/3.0);
        make.left.equalTo(self.mas_left).offset(5);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    _view_line1=[[UIView alloc]init];
    [self addSubview:_view_line1];
    _view_line1.backgroundColor=[UIColor grayColor];
    [_view_line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(10);
        make.left.equalTo(_btn_recharge.mas_right).offset(0);
        make.bottom.equalTo(self.mas_bottom).offset(-10);
        make.width.mas_equalTo(1);
    }];
    
    
    //提款
    _btn_withdraw=[[UIButton alloc]init];
    [_btn_withdraw setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_btn_withdraw setTitle:@"提款" forState:UIControlStateNormal];
    [self addSubview:_btn_withdraw];
    [_btn_withdraw mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(WIDTH_HeaderFooterView/3.0);
        make.left.equalTo(_btn_recharge.mas_right).offset(0);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    _view_line2=[[UIView alloc]init];
    [self addSubview:_view_line2];
    _view_line2.backgroundColor=[UIColor grayColor];
    [_view_line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(10);
        make.left.equalTo(_btn_withdraw.mas_right).offset(0);
        make.bottom.equalTo(self.mas_bottom).offset(-10);
        make.width.mas_equalTo(1);
    }];
    
    
    //站内信
    _btn_message=[[UIButton alloc]init];
    [_btn_message setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_btn_message setTitle:@"站内信" forState:UIControlStateNormal];
    [self addSubview:_btn_message];
    [_btn_message mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(WIDTH_HeaderFooterView/3.0);
        make.left.equalTo(_btn_withdraw.mas_right).offset(0);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end












































